package com.sxt.opd.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/opd")
public class OpdController {

    /**
     * 跳转挂号页面
     *
     */
    @RequestMapping("toGuaHaoManager")
    public String toGuaHaoManager() {
        return "opd/guahao/guaHaoManager";
    }
    /**
     * 跳转就诊列表
     *
     */
    @RequestMapping("toJiuZhenManager")
    public String toJiuZhenManager() {
        return "opd/jiuzhen/jiuZhenManager";
    }
    /**
     * 跳转医生门诊
     *
     */
    @RequestMapping("toTreatManager")
    public String toTreatManager(Model model,Integer patientid,String goodslistnum,Integer id) {
        if(patientid == null){
            model.addAttribute("patientid", 0);
            model.addAttribute("goodslistnum", null);
            model.addAttribute("jiuzhenid", null);
        }else{
            model.addAttribute("patientid", patientid);
            model.addAttribute("goodslistnum", goodslistnum);
            model.addAttribute("jiuzhenid", id);
        }
        return "opd/treat/treatManager";
    }

    /**
     * 跳转患者管理
     *
     */
    @RequestMapping("toPatientManager")
    public String toPatientManager() {
        return "opd/patient/patientManager";
    }

    /**
     * 跳转病历管理
     *
     */
    @RequestMapping("toRecordManager")
    public String toRecordManager(Model model,Integer patientid) {
        if(patientid == null){
            model.addAttribute("patientid", 0);
        }else{
            model.addAttribute("patientid", patientid);
        }
        return "opd/record/recordManager";
    }

}
